package com.vipboot.framework.core.exception;

import com.vipboot.framework.core.errorcode.UserErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 用户级别异常
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class UserException extends RuntimeException {

    /**
     * 错误码
     */
    private Integer code = UserErrorCode.UserError.getCode();

    public UserException(String message) {
        super(message);
    }

    public UserException(int code, String message) {
        super(message);
        this.code = code;
    }
}
